﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using SPPD.controller;
using SPPD.model;
namespace SPPD
{
    /// <summary>
    /// Interaction logic for Window3.xaml
    /// </summary>
    public partial class Window3 : Window
    {
        public List<sppd> list_sppd = new List<sppd>();
        public int select;
        public sppd edit = new sppd();
        public pegawai pegawaiLogin = new pegawai();
        public Window3(pegawai pgawai)
        {
            InitializeComponent();
            controller_sppd dummy = new controller_sppd();
            pegawaiLogin = pgawai;

            list_sppd = dummy.load();
            for (int i = 0; i < list_sppd.Count; i++)
            {
                if (list_sppd[i].status > 1)
                {
                    list_sppd.RemoveAt(i);
                }
            }
            data.ItemsSource = list_sppd;
            //List <SPPD.model.sppd> list_sppd = new List<sppd>();
            //list_sppd = dummy.load();
           
                //data.ItemsSource = list_sppd;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MainWindow main = new MainWindow();
            this.Hide();
            main.Show();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            form_pengajuan form = new form_pengajuan(pegawaiLogin);
            this.Hide(); form.Show();
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            pengajuan_spj spj = new pengajuan_spj(pegawaiLogin);
            this.Hide(); spj.Show();
        }
    }
}